
const path = require("path");
const multer = require("multer");

// 文件图片上传的参数
const storage = multer.diskStorage({
    destination:path.join(__dirname,'../static/admin/uploads'),
    filename:function(req,file,cb){
        var type = file.originalname.split(".")[1];
        cb(null,`${file.filename}-${Date.now().toString()}.${type}`)
    }
})

// 文件图片上传的实例
const upload = multer({storage:storage});



module.exports=upload;
